<?php

namespace App\Services;


use EasyWeChat\Factory;

class WorkWechatExternalContactService
{
    /**
     * 企业微信 客户联系[外部联系人]
     */

    private $corp_id = '';
    private $app = null;

    public function __construct()
    {
        $config = config('wechat.work.external_contact');
        $this->corp_id = $config['corp_id'];
        $this->app = Factory::work($config);
    }

    // 获取配置了客户联系功能的成员列表
    public function getFollowUsers()
    {
        $res = $this->app->external_contact->getFollowUsers();
        dd(__CLASS__, __FUNCTION__, $res);
    }

    // 获取配置了客户联系功能的成员列表
    public function getEexternalContact($external_userid)
    {
        $res = $this->app->external_contact->get($external_userid);
        dd(__CLASS__, __FUNCTION__, $res);
    }

}
